#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <string>
#include <clocale>
#include <vector>
#include "student.h"
#include "studentRegister.h"

using namespace std;

void main3_1_2(){

	cout << "main 3_1_2" << endl;

	student s1;
	student s2("Zlatan", "Svensson", 1994);
	
	s1.Write();
	s2.Write();
	s1.Read();
	s1.Write();

}

void main3_3(){
	string str="";
	cout << "main 3_3" << endl;
	student s1;
	student s2("Zlatan", "Svensson", 1994);
	cout << s1 << endl;
	cout << s2 << endl;

	cin >> s1;
	std::getline(cin, str);
	cout << s1 << endl;
}

void main3_4(){

	cout << "main 3_4" << endl;
	student s1("Zlatan", "Svensson", 1994);
	student s2("Lionel", "Svensson", 2012); 
	student s3("Zlatan", "Prytz", 1984);
	studentRegister sr;

	sr.add(s1);
	sr.add(s2);
	sr.add(s3);

	string s = sr.list();
	cout << s << endl;


}

void main3_5(){
	cout << "main 3_5" << endl;
	student s1("Zlatan", "Svensson", 1994);
	student s2("Lionel", "Svensson", 2012);
	student s3("Zlatan", "Prytz", 1984);
	studentRegister sr;

	sr.add(s1);
	sr.add(s2);
	sr.add(s3);

	sr.WriteToFile();
	
}

void main3_6(){
	cout << "main 3_6" << endl;
	studentRegister sr;
	sr.ReadFromFile();
	cout << sr.list();


}

int main(){

	main3_1_2();

	main3_3();
	
	main3_4();

	main3_5();

	main3_6();

	system("pause");

	return 0;

}